<?php
if($module=="module")
{
?>
    <div class="Filter">
        Filter:
        <select onchange="<?php echo selectAction('status')?>" >
            <option value="-1">select status</option>
            <?php echo liststatus($status)?>
        </select>
        &nbsp;
        <select onchange="<?php echo selectAction('place')?>" >
            <option value="-1">all pages</option>
            <?php echo list_place_Menu($place)?>
        </select>
        <?php echo buttonResetPage()?>
    </div>
    <form name="form_admin" method="post" action="<?php echo formAction('updatestatus')?>">
    	<table width="100%" border="0" cellpadding="3" cellspacing="1"  id="tblsort">
    		<tr class="headtb"  nodrop="true" nodrag="true">
    			<td width="5%" ><?php echo _ORDER?></td>
    			<td width="25%"><?php echo _MODUNLENAME?></td>
    			<td width="10%" ><?php echo _STATUS?></td>
    			<td width="10%" ><?php echo _MENU?></td>
    			<td width="15%" ><?php echo _ACTIONS?></td>
    			<td>&nbsp;</td>
    		</tr>
    <?php
    	foreach($categories as $i => $category)
    	{
    	?>
    	<tr>
    		<td align="center">
    			<input class="ordertext"  id="listorder_<?php echo $i?>" name="listorder[]"
    			value="<?php echo getOrderList($i)?>" />
    		</td>
    		<td nowrap="nowrap" style="padding-left:10px" valign="middle">
    			<?php echo linkAction('edit',$category['cName'],'id='.$category['iId'])?>
    			<input type="hidden" name="listid[]" value="<?php echo $category['iId']?>" />
    		</td>
    		<td align="center">
    			<select id="liststatus_<?php echo $i?>" name="liststatus[]">
    				<?php echo liststatus($category["iStatus"]) ?>
    			</select>
    		</td>
    		<td align=center>
    			<select name='listplace[]' id='listplace[]'>
    				<?php echo list_place_Menu($category["iPlace"])?>
    			</select>
    		</td>

    		<td align="center">
    			<a href="/<?php echo $category["cUrlString"]?>" target="_blank"><?php echo _VIEW?></a> -
    			<?php echo linkAction('edit',_EDIT,'&id='.$category['iId'])?> -
    			<?php echo linkAction('delete',_DELETE,'id='.$category['iId'])?>
            </td>
    		<td></td>
    	</tr>
    <?php
    }
    ?>
    	</table>
    <?php echo $show_page?>
    </form>
<?php
}else
{
?>
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    	<td height="10" colspan="3"></td>
    </tr>
    <tr>
    	<td valign="top">
            <div class='listmoduleleft'>
    		  <?php echo $listcatmodunle ?>
            </div>
    	</td>
    	<td width="78%" style="border-left:1px solid #dddddd;" valign="top">
    <?php
    if(count($categories) >0)
    {
    ?>
    <div class="Filter">
        Filter:
        <select onchange="<?php echo selectAction('status','&id='.$id)?>" >
            <option value="-1">select status</option>
            <?php echo liststatus($status)?>
        </select>
        &nbsp;
        <?php echo buttonResetPage()?>
    </div>
    <form name="form_admin" method="post" action="<?php echo formAction('updatestatus')?>">
    <table width="100%"  cellpadding="4" cellspacing="1" id="tblsort">
    	<tr class="headtb" nodrop="true" nodrag="true">
    		<td width="5%" ><?php echo _ORDER?></td>
            <td width="5%"><?php echo inputCheckAll()?></td>
    		<td width="20%" >Category Name</td>
    		<td width="10%" ><?php echo _STATUS?></td>
    		<td width="20%" ><?php echo _ACTIONS?></td>
    		<td>&nbsp;</td>
    	</tr>
        <?php
    	foreach($categories as $i => $category)
    	{
    	?>
    		<tr>
    			<td align="center">
    				<input class="ordertext" id="listorder_<?php echo $i?>" name="listorder[]"
    				value="<?php echo getOrderList($i)?>"/>
    			</td>
                <td align="center"><?php echo inputCheck($category['iId'])?></td>
    			<td nowrap="nowrap" style="padding-left:10px" valign="middle">
                    <?php echo linkAction('edit',$category['cName'],'id='.$category["iId"])?>
    				<input type="hidden" name="listid[]" value="<?php echo $category['iId']?>" />
    			</td>
    			<td align="center">
    				<select id="liststatus_<?php echo $i?>" name="liststatus[]">
    					<?php echo liststatus($category["iStatus"]) ?>
    				</select>
    			</td>

    			<td align="center">
    				<?php echo linkAction('edit',_EDIT,'id='.$category["iId"])?> -
                    <?php echo linkAction('delete',_DELETE,'id='.$category["iId"])?>
    			</td>
    			<td></td>
    		</tr>
    	<?php
    	}
        ?>
     </table>
    <?php
    }else
    {
    ?>
    <div class="Filter">
        Filter:
        <select onchange="<?php echo selectAction('status','&id='.$id)?>" >
            <option value="-1">select status</option>
            <?php echo liststatus($status)?>
        </select>
        &nbsp;
        <?php echo buttonResetPage()?>
    </div>
    <form name="form_admin" method="post" action="<?php echo formAction('updatestatuscontent')?>">
    <table width="100%"  cellpadding="4" cellspacing="1" id="tblsort">
    	<tr class="headtb" nodrop="true" nodrag="true">
    		<td width="5%" ><?php echo _ORDER?></td>
            <td width="5%"><?php echo inputCheckAll()?></td>
    		<td width="20%" >Content Name</td>
    		<td width="10%" ><?php echo _STATUS?></td>
    		<td width="20%" ><?php echo _ACTIONS?></td>
    		<td>&nbsp;</td>
    	</tr>
        <?php

        if(!is_array($contents))$contents=array();
    	foreach($contents as $i => $content)
    	{
    	?>
    	<tr>
    		<td align=center>
    			<input class="ordertext" id="listorder_<?php echo $i?>" name="listorder[]"
    			value="<?php echo getOrderList($i)?>">
    		</td>
            <td align="center"><?php echo inputCheck($content['iId'])?></td>
    		<td nowrap="nowrap">
                <?php echo linkAction('editcontent',$content["cName"],'id='.$content["iId"])?>
    		      <input type="hidden" name="listid[]" value="<?php echo $content["iId"]?>" />
    		</td>
    		<td align=center>
    			<select name="liststatus[]" id="iStatus_content_<?php echo $i ?>">
    				<?php echo  liststatus($content["iStatus"]);?>
    			</select>
    		</td>

    		<td align=center>
    			<?php echo linkAction('editcontent',_EDIT,'id='.$content["iId"])?> -
                <?php echo linkAction('delcontent',_DELETE,'id='.$content["iId"])?>
    		</td>
    		<td></td>
    		</tr>
    	<?php
    	}
        if(count($contents)==0)
        {
        ?>
        <tr>
             <td align="center" colspan="5">
                <font color="Red"><?php echo _NOTFOUNDCONTENT?></font>
            </td>
        </tr>
        <script>showhide('applybut');</script>
        <?php
        }
    	?>
        </table>
    <?php
    }
    ?>
	</td>
</tr>
<tr>
	<td></td>
	<td><?php echo $show_page?></td>
</tr>
</table>
<?php
}
?>
<script type="text/javascript">
(new TableDnD).init("tblsort");
</script>
